package com.dcy;

import com.dcy.dao.StudentDao;
import com.dcy.domain.Student;
import com.dcy.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class starter04 {
    public static void main(String[] args) {
        //测试使用${}占位符
        SqlSession sqlSession= MyBatisUtil.getSqlSession();
        StudentDao studentDao = sqlSession.getMapper(StudentDao.class);
        //下面的一定要加上一对单引号， 因为${ }占位符是将字符串直接相加的
        List<Student> students = studentDao.queryStudent("'江小白'");
        System.out.println(students);
        List<Student> studentList = studentDao.queryStudentOrderByColume("name");
        System.out.println(studentList);
    }
}
